package org.academic.texteditor.gui.component;

import java.awt.Component;

import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;


public class JScroll extends JScrollPane {

	private static final long serialVersionUID = 2796328781818732610L;

	private final Component component;

	JScroll(Component component) {
		super(component);
		this.component = component;
	}

	public Component getComponent() {
		return component;
	}

	public PageContainer getPageContainer() {
		if (component instanceof PageContainer) {
			return (PageContainer) component;
		}
		return null;
	}
	
	public JTextArea getTextArea() {
		if (component instanceof JTextArea) {
			return (JTextArea) component;
		}
		return null;
	}

	public JGrid getGrid() {
		if (component instanceof JGrid) {
			return (JGrid) component;
		}
		return null;
	}

	public JList getLista() {
		if (component instanceof JList) {
			return (JList) component;
		}
		return null;
	}

}
